package com.youcan.service;

import java.io.Serializable;
import java.util.List;
 

/**
 * @author LiChao E-mail:what_is_javascript@163.com
 * @date:2012-8-22 下午09:26:25
 * @version :V1.0
 *
 */

public interface Service<T> {

	//增加
	public T addEntity(T object);
	//删除
	public void deleteEntity(T object);
	//修改
	public T updateEntity(T object);
	
	//通过主键查询
	public T findById(String className,Serializable id);
	//通过主键查找对象 ， 并加锁
	public T findByIdAndLock(String className,Serializable id,boolean lock);
	//通过属性查找list
	public List<T> findByProp(String className,String property,Object value);
	public T findUniqueByProp(String className,String property,Object value);
	public List<T> findAll(String className);
	public List<T> findByCriteria(Object...objects);
	
}
